/// 售卖礼品卡参数
class SellGiftCardDto {
  /// 卡种类ID
  final int cardTypeId;
  /// 卡分类ID
  final int cardCategoryId;
  /// 卡片额度
  final int cardAmount;
  /// 卡片价值
  final int cashValue;
  /// 手机客户提交订单前查到的最高核销报价，单位美元
  final String price;
  /// 手机客户提交订单前查到的最高财务报价，美元兑换奈拉的汇率
  final String rate;
  /// 手机客户提交订单前查到的平台折扣，小数
  final String discount;
  /// 卡片代码
  final List<String>? cardCodeList;
  /// 卡片地址
  final List<String> cardUrlList;

  SellGiftCardDto({
    required this.cardTypeId,
    required this.cardCategoryId,
    required this.cardAmount,
    required this.cashValue,
    required this.price,
    required this.rate,
    required this.discount,
    this.cardCodeList,
    required this.cardUrlList,
  });

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['cardTypeId'] = cardTypeId;
    data['cardCategoryId'] = cardCategoryId;
    data['cardAmount'] = cardAmount;
    data['cashValue'] = cashValue;
    data['price'] = price;
    data['rate'] = rate;
    data['discount'] = discount;
    if (cardCodeList != null) data['cardCodeList'] = cardCodeList;
    data['cardUrlList'] = cardUrlList;
    return data;
  }

  factory SellGiftCardDto.fromJson(Map<String, dynamic> json) {
    return SellGiftCardDto(
      cardTypeId: json['cardTypeId'],
      cardCategoryId: json['cardCategoryId'],
      cardAmount: json['cardAmount'],
      cashValue: json['cashValue'],
      price: json['price'],
      rate: json['rate'],
      discount: json['discount'],
      cardCodeList: json['cardCodeList'] != null ? List<String>.from(json['cardCodeList']) : null,
      cardUrlList: json['cardUrlList'] != null ? List<String>.from(json['cardUrlList']) : [],
    );
  }
}